<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page import="triperest.*" %>
<%@ page import="java.util.ArrayList" %>
<%
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
<html>
  <head>
    <%@ include file="head.jsp" %>
    <script src="js/tripDetails.js" type="text/javascript"></script>
    <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
    
  </head>

  <body>
  <%@ include file="header.jsp" %>
  
  <% 
  ArrayList<Trip> trips = user.getTrips();
  %>
    <h4>Trip Details</h4><select id="tripPicker" class="lfloat">
    <%for(int i = 0; i < trips.size(); i++){%>
    <option value="<%= trips.get(i).getId() %>"><%= trips.get(i).getName() %></option>
    <%}%>
    </select>
    
    <div class="detailButtons">
    <input style="display:none" class="button littleButton lfloat" type="button" id="editTrip" value="Edit Trip">
    <input style="display:none" class="button littleButton lfloat" type="button" id="saveTrip" value="Save Trip">
	<div class="plusOne rfloat"><div class="g-plusone" data-href="http://triperest.appspot.com/"></div></div>
    </div>
    <div class="clear divLine"></div>

    
    
    <input id="tripId" type="hidden" value="<%= request.getParameter("trip") %>">
  <%
  Trip trip;
  if(request.getParameter("trip") != null) {
  	trip = new Trip(Long.valueOf(request.getParameter("trip")));
  }
  else
  	trip = new Trip();
  ArrayList<Destination> destinations = trip.getDestinations();
  %>

    <div class="clear"></div>
    <div class="tripInfo">
    	<div class="tripPic lfloat"><img src="img/camping.jpg"></div>
	    <input id="tripName" disabled="disabled" param="name" class="tripName" value="<%= trip.getName() %>">
	    <br /><input id="tripDescription" disabled="disabled" param="description" class="tripDescription" value="<%= trip.getDescription() != null ? trip.getDescription() : "Add Description" %>">
    </div>
    <div class="clear"></div>
    <div id="tripForm">
	<ul>
	<li class="divLine bottomGap">
		<label><h4 class="startText">Waypoints</h4></label>
	     <ul id="waypointList" class="waypointDetailList">
	
		</ul>
	<div class="clear"></div>
	 </li>
	 </ul>
	</div>
	<div id="map">
		<div id="trip-slides">
				    <div id="map_canvas"></div>
		</div>
	</div>
	<%@ include file="footer.jsp" %>
  </body>
</html>
